home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / mac / After Effects 3.1 SDK Mac / Examples / UI Samples / Custom UI in comp⁄layer / AEFX_Sample.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-06  |  3.0 KB  |  135 lines  |  [TEXT/CWIE]

  1. /**
  2.     AEFX_Sample.h
  3.     
  4.     Part of the Adobe After Effects 3.1 SDK    
  5.     Copyright (c)1993-96, Adobe Systems Inc, All Rights Reserved.
  6.  
  7.     Revision History
  8.         1.0, created by dmw
  9. **/
  10.  
  11. #ifndef _H_AEFX_SAMPLE
  12. #define _H_AEFX_SAMPLE
  13.  
  14. #include "AE_EffectUI.h"
  15. #include "AE_EffectCB.h"
  16. #include "AE_Macros.h"
  17.  
  18. #include <A4Stuff.h>
  19.  
  20. #if    !defined(powerc)
  21.  
  22. #define SAM_DECLARE_A4            long old_a4;
  23. #define    SAM_SET_A4                old_a4 = SetCurrentA4();
  24. #define    SAM_RESTORE_A4            SetA4(old_a4);
  25.  
  26. #else
  27.  
  28. #define SAM_DECLARE_A4
  29. #define    SAM_SET_A4    
  30. #define    SAM_RESTORE_A4
  31.  
  32. #endif
  33.  
  34.  
  35. #define FIX2INT(X)                ((long)(X) >> 16)
  36. #define INT2FIX(X)                ((long)(X) << 16)
  37. #define FIX2INT_ROUND(X)        (FIX2INT((X) + 32768))
  38. #define    FIX_2_FLOAT(X)            ((double)(X) / 65536.0)
  39. #define    FLOAT2FIX(F)            ((PF_Fixed)((F) * 65536 + (((F) < 0) ? -0.5 : 0.5)))
  40. #define ABS(N)                    ((N) < 0 ? -(N) : (N))
  41.  
  42. #define    PF_RECT_2_FIXEDRECT(R,FR)    do {    \
  43.     (FR).left = INT2FIX((R).left);            \
  44.     (FR).top = INT2FIX((R).top);            \
  45.     (FR).right = INT2FIX((R).right);        \
  46.     (FR).bottom = INT2FIX((R).bottom);        \
  47.     } while (0)
  48.  
  49. #define    PF_FIXEDRECT_2_RECT(FR,R)    do {    \
  50.     (R).left = FIX2INT_ROUND((FR).left);    \
  51.     (R).top  = FIX2INT_ROUND((FR).top);        \
  52.     (R).right = FIX2INT_ROUND((FR).right);    \
  53.     (R).bottom = FIX2INT_ROUND((FR).bottom);\
  54.     } while (0)
  55.  
  56. #define SAM_SLOP        16
  57.  
  58. #define    MAJOR_VERSION    1
  59. #define    MINOR_VERSION    1
  60. #define    BUG_VERSION        0
  61. #define    STAGE_VERSION    PF_Stage_RELEASE
  62. #define    BUILD_VERSION    0
  63.  
  64. #define    NAME    "Custom UI"
  65. #define    DESCRIPTION "Sample of a custom UI element."
  66.  
  67. enum {
  68.     SAM_X_RADIUS    = 1,
  69.     SAM_Y_RADIUS,
  70.     SAM_PT,
  71.     SAM_NUM_PARAMS
  72. };
  73.  
  74. #define    SAM_RADIUS_BIG_MAX    INT2FIX(8000L)
  75. #define    SAM_RADIUS_MAX        INT2FIX(250L)
  76. #define    SAM_RADIUS_MIN         0
  77. #define    SAM_RADIUS_DFLT        INT2FIX(50L)
  78.  
  79. #define SAM_PTX_DFLT           INT2FIX(50L)
  80. #define SAM_PTY_DFLT           INT2FIX(50L)
  81.  
  82.  
  83. typedef struct {
  84.     PF_Fixed    left, top, right, bottom;
  85. } PF_FixedRect;
  86.  
  87. typedef void (*FrameFunc)(PF_InData*, PF_EventExtra*, Point*, Point*, PF_FixedPoint*);
  88.  
  89.  
  90. PF_Err SAM_RotateMatrixPlus (
  91.                         PF_FloatMatrix *m,        /* <> */
  92.                         PF_InData *in_data,        /* << */
  93.                         PF_FpLong degrees,        /* >> */
  94.                         PF_FpLong aboutX,        /* >> */
  95.                         PF_FpLong aboutY );        /* >> */
  96.  
  97.  
  98. PF_Err SAM_SetIdentityMatrix (PF_FloatMatrix *matrix);
  99.  
  100.  
  101. PF_Err SAM_ScaleMatrix (
  102.                         PF_FloatMatrix *m,        /* <> */
  103.                         PF_FpLong scaleX,        /* >> */
  104.                         PF_FpLong scaleY,        /* >> */
  105.                         PF_FpLong aboutX,        /* >> */
  106.                         PF_FpLong aboutY );        /* >> */
  107.  
  108.  
  109.  
  110. PF_Err SAM_RotateMatrixPlus (
  111.                         PF_FloatMatrix *m,        /* <> */
  112.                         PF_InData *in_data,        /* << */
  113.                         PF_FpLong degrees,        /* >> */
  114.                         PF_FpLong aboutX,        /* >> */
  115.                         PF_FpLong aboutY );        /* >> */
  116.  
  117. PF_Err SAM_ConcatMatrix (
  118.                         const PF_FloatMatrix *src,        /* >> */
  119.                         PF_FloatMatrix *dst );            /* <> */
  120.                 
  121. PF_Err SAM_TransformFixPoints (
  122.                         const PF_FloatMatrix *m,    /* >> */
  123.                         long count,                    /* >> */
  124.                         PF_FixedPoint *pts );        /* <> */
  125.  
  126.  
  127. PF_Err HandleEvent (
  128.                         PF_InData        *in_data,
  129.                         PF_OutData        *out_data,
  130.                         PF_ParamDef        *params[],
  131.                         PF_LayerDef        *output,
  132.                         PF_EventExtra    *event_extra );
  133.  
  134. #endif
  135.